home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / Storage / Bento / CM / Utility.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  2.7 KB  |  82 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Utility.h
  3.  
  4.     Contains:    Container Manager Miscellaneous Utility Routines Interfaces
  5.  
  6.     Written by:    Ira L. Ruben
  7.  
  8.     Owned by:    Ed Lai
  9.  
  10.     Copyright:    © 1991-1994 by Apple Computer, Inc., all rights reserved.
  11.  
  12.     Change History (most recent first):
  13.  
  14.          <2>     8/26/94    EL        #1181622 Ownership update.
  15.          <1>      2/3/94    EL        first checked in
  16.  
  17.     To Do:
  18. */
  19.  
  20. /*---------------------------------------------------------------------------*
  21.  |                                                                           |
  22.  |                         <<<     Utility.h     >>>                         |
  23.  |                                                                           |
  24.  |        Container Manager Miscellaneous Utility Routines Interfaces        |
  25.  |                                                                           |
  26.  |                               Ira L. Ruben                                |
  27.  |                                 12/02/91                                  |
  28.  |                                                                           |
  29.  |                  Copyright Apple Computer, Inc. 1991-1994                 |
  30.  |                           All rights reserved.                            |
  31.  |                                                                           |
  32.  *---------------------------------------------------------------------------*
  33.  
  34.  This file containes a collection of generally usefull utility routines that don't
  35.  logically fit anywhere else.
  36. */
  37.  
  38. #ifndef __UTILITYROUTINES__
  39. #define __UTILITYROUTINES__
  40.  
  41.  
  42. #ifndef __CMTYPES__
  43. #include "CMTypes.h"
  44. #endif
  45. #ifndef __HANDLERS__
  46. #include "Handlers.h"
  47. #endif
  48. #ifndef __TOCENTRIES__
  49. #include "TOCEnts.h"   
  50. #endif
  51. #ifndef __TOCOBJECTS__
  52. #include "TOCObjs.h"   
  53. #endif
  54. #ifndef __CONTAINEROPS__
  55. #include "Containr.h"  
  56. #endif
  57.  
  58.                                                                     CM_CFUNCTIONS
  59.  
  60.  
  61. CM_CHAR *cmltostr(CM_LONG n, CM_SHORT width, CMBoolean hexConversion, CM_CHAR *s);
  62.     /*
  63.     Converts the (long) integer n to a string. IF width>0 and width > strlen(string), then
  64.     the number will be right-justified in a string of width characters.  If width<0 and 
  65.     abs(width) > length(string), then the number is again right-justified but padded with
  66.     leading zeros instead of blanks.    In this case a negative number will have a minus as
  67.     its first character.  If width is too small the entire number is returned overflowing
  68.     the width.
  69.     
  70.     If hex conversion is desired, set the hexConversion parameter to true.
  71.     
  72.     The function returns the specified string parameter as its value. That string is assumed
  73.     large enough to hold the number.
  74.     
  75.     Note, this routine is provided as a substitute for sprintf().  It is more compact,
  76.     faster, and doesn't "drag" in a shit-load of I/O library routines with it.
  77.     */
  78.     
  79.     
  80.                                                           CM_END_CFUNCTIONS
  81. #endif
  82.